{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import cv2\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAD7hJREFUeJzt3X+sX3V9x/Hna63oQF0prKSj3VpM\nw8bMNpqm66YxRuYGnaGYSFKzxMY1IctwgzkjZfwx/xz7IZvJRtIJW10IiIixWXTadCzbH6MDOkop\nFSioULi0OhWMJnPV9/44nwvf1u/t/d7P+X3O65HcfO/33O+953PPPa/v+3PO99z3VxGBmS3NT7Q9\nALM+cnDMMjg4ZhkcHLMMDo5ZBgfHLENtwZF0paQnJR2TtKuu9Zi1QXW8jiNpGfAU8G7gOPAQ8P6I\neKLylZm1oK6Ksxk4FhHPRsQPgHuAbTWty6xxy2v6uRcDz0/cPw786kIPluTLF6wrvhkRP73Yg+oK\njqYsOy0ckq4Drqtp/Wa5vj7Lg+oKznFg7cT9NcCLkw+IiN3AbnDFsf6p6xjnIWCDpPWSzgG2A3tr\nWpdZ42qpOBFxStKHgC8By4A7I+JIHesya0Mtp6OXPAhP1aw7HomITYs9yFcOmGVwcMwyODhmGRwc\nswwOjlkGB8csQ11XDtjALfQyhjTtaqvhcXBsQTmv8UXEKMLjqZpZBlcc+zFlryaZ//4hVx5XHLMM\nDo6dpgvXLvaBg2OWwcGxV1VdbYZcvXxywGrdwYd6osAVxyyDg2OWwcExy+DgmGVwcMwyZAdH0lpJ\nD0g6KumIpBvS8pWS9kl6Ot2eX91wrW8k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16B0u6rB8czbDtw9cb+t7TNv\noW1S677VdnBmbmDYBElvBD4L3BgRr1D0vn4L8CvAHPBXDQ7nbRGxkaIf9/WS3tHguqeSdA5wNfCZ\ntKjN7bOYWvettoMzcwPDukl6HUVo7oqI+wEi4kRE/DAifkTR7mpzU+OJiBfT7Ungc2ndJ+anG+n2\nZFPjSa4CDkbEiTS21rbPhIW2Sa37VtvBeQjYIGl9ejbbTtHUsFEqWnveARyNiI9PLJ+cE78X+LG3\nOqlpPOdJetP85xTthh+n2DY70sN2AJ9vYjwT3s/ENK2t7XOGhbZJvc0xmz4rM+VMyVaKs1jPALe0\nNIa3U5Txx4BH08dW4J+Aw2n5XmB1Q+O5hOIM4yHgyPx2AS4A9gNPp9uVDW6jc4H/AX5qYlmj24ci\ntHPA/1FUlJ0LbROKqdrfpv3qMLCpyrH4ygGzDG1P1cx6ycExy+DgmGVwcMwyODhmGRwcswwOjlkG\nB8csw/8DSRJjBhEY9m4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "img=cv2.imread('i.png')\n",
    "plt.imshow(img)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAD2BJREFUeJzt3X+MHOV9x/H3p3ZICklqDDVysVub\nyKKlUVssy3WbKIpC04IbYSoFyVGlWKklVJW00DQKpvzR/Fn6I7SRWqRroCUVglBCFKtK2lguVftH\ncQEXY4wDGJLAwWEnTQJRIjV18u0f82xZH7u+3Wdm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VloegDLeDwra9uYZjae1hzjmHVJmyqOWWc0HhxJV0p6KjUx3NfQGDZKelDScUnHJN2Q\nln9c0ouSHksfO2c4pq9KOpoe95G0bK2kA5KeSbfnz2gslw5tg8ckvSrpxllvn1HNMcdtk9qbYw7e\nu7KJD2AV8CxwCXAOcAS4rIFxrKfomwDwFuBp4DLg48BHG9o2XwUuXLbsT4B96fN9wK0N/c1epni+\nY6bbB3gXsBV4YqVtAuwEvkjReWkHcKjKsTRdcbYDJyLiuYj4PnAvRVPDmYqIpYg4nD7/DnCcdvaD\n2wXclT6/C7imgTFcATwbEV+b9QPH6OaY47ZJrc0xmw5O6xoYStoEXA4cSos+nEr9nbOaGiUBfEnS\no6kHHcBFkboGpdt1MxzPwG7gnqH7TW2fgXHbpNZ9q+ngTNzAcBYkvRn4LHBjRLxK0fv6bcAvAEvA\nn89wOO+IiK0U/bivl/SuGT72SJLOAa4G/iEtanL7rKTWfavp4EzcwLBukt5AEZq7I+IBgIg4GRE/\niIgfUrS72j6r8UTES+n2FPC59NgnB9ONdHtqVuNJrgIOR8TJNLbGts+Qcduk1n2r6eA8DGyRtDn9\nN9tN0dRwplS0JL0DOB4RnxhaPjwn/g3gdW91UtN4zpP0lsHnFO2Gn6DYNnvSanuAz89iPEM+wNA0\nrants8y4bVJvc8xZn5UZcaZkJ8VZrGeBWxoawzspyvjjwGPpYyfw98DRtHw/sH5G47mE4gzjEeDY\nYLsAFwAHgWfS7doZbqNzgf8Gfmxo2Uy3D0Vol4D/pagoe8dtE4qp2l+l/eoosK3KsfjKAbMMTU/V\nzDrJwTHL4OCYZXBwzDI4OGYZHByzDA6OWQYHxyzD/wHKEWDV/k5SAgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 腐蚀\n",
    "img=cv2.imread('i.png')\n",
    "kernel = np.ones((5,5),np.uint8)\n",
    "erosion = cv2.erode(img,kernel,iterations = 1)\n",
    "plt.imshow(erosion)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAD79JREFUeJzt3W+sHNV9xvHvUzskhSTlX41cTGsT\nIVoatcWyKG2iKApNC26EqRQkR5WCUkuoKmmhaRRMedG8LP0T2kgt0m2gdSoEoYQoVpW0sVyq9kVx\nARdjjAMYkoDhYidNAlEiNXXy64s5W9aXvb57z+7MnJl5PpK1d+fOvXPueJ79nZnd/a0iAjNbnR9p\newBmXeTgmGVwcMwyODhmGRwcswwOjlmG2oIj6UpJT0k6ImlnXdsxa4PqeB5H0hrgaeC9wFHgYeAD\nEfHk3Ddm1oK6Ks5lwJGIeC4ivg/cC2yraVtmjVtb0+89H3hh7P5R4BeXW1mSX75gpfhGRPz4SivV\nFRxNWHZSOCRdD1xf0/bNcn1tmpXqCs5R4IKx+xuAl8ZXiIgFYAFccax76jrHeRi4SNImSacB24Hd\nNW3LrHG1VJyIOCHpw8A/A2uAuyLiUB3bMmtDLZejVz0IT9WsHI9GxJaVVvIrB8wyODhmGRwcswx1\nXY62Hlrt+bA06em8fnBw7CTzvFgUEb0Nj6dqZhkcHPt/dTw1ERG1/N62OThmGRwcswy+OGC9nErV\nzRVn4JoKTd/C6YozUG0cyKNt9uEStSuOWQYHxyyDg2OWwcExy+DgmGVwcMwyODhmGRwcswzZwZF0\ngaQHJR2WdEjSjWn52ZL2SHom3Z41v+GalWGWinMC+IOI+BngcuAGSZcAO4G9EXERsDfdN+uV7OBE\nxGJE7E9ffwc4TNUzehuwK622C7hm1kGalWYu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6n6cd8g6V0Nbnsi\nSacBVwP/kBa1uX9WUuux1XZwpm5gWDdJb6AKzd0R8QBARByLiB9ExA+p2l1d1tR4IuKldHsc+Fza\n9rHRdCPdHm9qPMlVwP6IOJbG1tr+GbPcPqn12Go7OA8DF0nalB7NtlM1NWyUqo6CdwKHI+ITY8vH\n58S/Abzuo05qGs8Zkt4y+pqq3fATVPvmurTadcDnmxjPmA8wNk1ra/8ssdw+qbc5ZtNXZSZcKdlK\ndRXrWeDWlsbwTqoy/jjwWPq3Ffh74GBavhtY39B4LqS6wngAODTaL8A5wF7gmXR7doP76HTgv4Ef\nG1vW6P6hCu0i8L9UFWXHcvuEaqr2V+m4OghsmedY/MoBswxtT9XMOsnBMcvg4JhlcHDMMjg4Zhkc\nHLMMDo5ZBgfHLMP/AfkIeJ5sQNCXAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 膨胀\n",
    "img=cv2.imread('i.png')\n",
    "dilation = cv2.dilate(img,kernel,iterations = 1)\n",
    "plt.imshow(dilation)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAH7pJREFUeJztnX3MZ0dVx7/HloLlxbZUcG2rbUmD\nVqLS3dQqhBAqUgrpYkKTJUYarGmMgCAS2No/5E/xBZRESVaKFtMUKi9hY6qyqTVoYgvdSmlLKZRS\ny9KlW+Q1kIiF4x/33jB7Oy9nZs7cO3f3fJInz/O7v7kz5869Z+bMOefOQ8wM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H3aQv20ckA/gfAjznHFu0fDEp7GMD/YZhRrgz1CQZT\n7a/G5+ouALs0ZbHMAcMoYG1TzTA2iSmOYRRgimMYBZjiGEYBpjiGUYApjmEUYIpjGAWY4hhGAf8P\nd3sQXJ801Y4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import random\n",
    "\n",
    "\n",
    "def SaltAndPepper(src,percetage,x,y):  \n",
    "    SP_NoiseImg=src \n",
    "    SP_NoiseNum=int(percetage*src.shape[0]*src.shape[1]) \n",
    "    for i in range(SP_NoiseNum): \n",
    "        randX=random.randrange(0,src.shape[0]-1) \n",
    "        randY=random.randrange(0,src.shape[1]-1) \n",
    "        if random.randrange(0,1)==0: \n",
    "            SP_NoiseImg[randX,randY]=x\n",
    "        else: \n",
    "            SP_NoiseImg[randX,randY]=y\n",
    "    return SP_NoiseImg\n",
    "\n",
    "img=cv2.imread('i.png')\n",
    "SaltAndPepper_noiseImage = SaltAndPepper(img,0.1,255,0)\n",
    "plt.imshow(SaltAndPepper_noiseImage)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAD49JREFUeJzt3X+sX3V9x/Hna63oQF0prKSj3VpM\nw8bMNpqm66YxRuYGnaGYSFKzxMY1IctwgzkjZfwx/xz7IZvJRtIJW10IiIixWXTadCzbH6MDOqCU\nChRUKFxanQpGk7nqe3+cz6Xf1u/t/d7P+X3O65Hc3Ps999x7Pvf0vL7vzznf0/dXE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nf4m8L30uSsuxONZTNfGVMV4fm6WlTpxyw2ApIdnudWhKR7P4ro2pibH46maWQYHxyxDl4Kzu+0B\nnMHjWVzXxtTYeDpzjmPWJ12qOGa90XpwJF0p6anUxHBXS2NYK+kBSUckHZZ0Q1r+MUkvSno0fWxt\ncExfk3QobffhtGylpH2Snkmfz29oLJdO7INHJb0q6cam98+05pgL7ZPam2POv4V5Gx/AMuBZ4BLg\nHOAx4LIWxrGaom8CwJuAp4HLgI8BH2lp33wNuPCMZX8O7Epf7wJubenf7GWK1zsa3T/AO4CNwBOL\n7RNgK/BFis5LW4ADVY6l7YqzGTgaEc9FxA+AeyiaGjYqIuYi4mD6+rvAETrSD+4M24A96es9wDUt\njOEK4NmI+HrTG47pzTEX2ie1NsdsOzida2AoaR1wOXAgLfpQKvV3NjU1SgL4sqRHUg86gIsidQ1K\nn1c1OJ5524G7Jx63tX/mLbRPaj222g7OzA0MmyDpjcBngRsj4lWK3tdvAX4FmAP+qsHhvC0iNlL0\n475e0jsa3PZUks4BrgY+kxa1uX8WU+ux1XZwZm5gWDdJr6MIzV0RcT9ARByPiB9GxI8o2l1tbmo8\nEfFS+nwC+Fza9vH56Ub6fKKp8SRXAQcj4ngaW2v7Z8JC+6TWY6vt4DwEbJC0Pj2bbadoatgoFa09\n7wCORMTHJ5ZPzonfC/zYW53UNJ7zJL1p/muKdsNPUOybHWm1HcDnmxjPhPczMU1ra/+cYaF9Um9z\nzKavyky5UrKV4irWs8AtLY3h7RRl/HHg0fSxFfgn4FBavhdY3dB4LqG4wvgYcHh+vwAXAPuBZ9Ln\nlQ3uo3OB/wF+amJZo/uHIrRzwP9RVJSdC+0Tiqna36bj6hCwqcqx+M4BswxtT9XMesnBMcvg4Jhl\ncHDMMjg4ZhkcHLMMDo5ZBgfHLMP/A+4+UOq+9dqYAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 开运算（去噪）\n",
    "opening = cv2.morphologyEx(SaltAndPepper_noiseImage, cv2.MORPH_OPEN, kernel)\n",
    "plt.imshow(opening)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAEpVJREFUeJzt3X3MJeVZx/Hv5W5phbbyJmRlUZaG\noNiobAiibZqmWIW1YTEpyTYmJXUTYqQK1qYs8of9U3wp2kRJ1oJSQ6CU0nRjWu1mxegfsvIisCxb\nYKEtLDzstraFpk2stJd/zH1gnsPMmZl73md+n2TzPM+cOc/cz9m5znXPfe65bnN3RKSaH+u7ASJj\npMARiaDAEYmgwBGJoMARiaDAEYnQWuCY2SVm9oSZHTazXW0dR6QP1sbnOGa2AXgSeC9wBLgf+IC7\nP974wUR60FbGuRA47O7PuPsPgDuB7S0dS6RzG1v6vWcAz6V+PgL8ct7OZqbpCzIU33T3nyzaqa3A\nsYxt64LDzK4Crmrp+CKxvl5mp7YC5whwZurnzcAL6R3cfTewG5RxZHzausa5HzjHzLaY2XHADmBP\nS8cS6VwrGcfdXzGzDwP/AmwAbnX3g20cS6QPrQxHV26EumoyHA+6+wVFO2nmgEgEBY5IBAWOSAQF\njkgEBY5IBAWOSIS2Zg7IxOV9jGGWNdtqehQ4ksvdXw2E5UBJb09/n/55ytRVE4mgjCOvk84ui+/N\nLLd7trw9/ZypUuBIKXnBAesDZAhTuLqgwJF1Vp34edc7cwmWNF3jiERQ4MirijLHYtQsz/I1zZQz\nkQJHGpMVKEXBNlYKHJEIChzJzQplh5PNbNJDz1k0qia5ynaxptgVK6KMI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ddj7r7D939RyTlri7sqj3u/kL4egz4fDj20UV3I3w91lV7gkuBh9z9\naGhbb69PSt5r0uq51Xfg3A+cY2ZbwrvZDpKihp2ypFznLcAhd/9Eanu6T/xbwOuWOmmpPSeY2VsW\n35OUG36M5LW5Mux2JfCFLtqT8gFS3bS+Xp8lea9Ju8Uxux6VyRgp2UYyivU0cENPbXgnSRp/FHg4\n/NsG/CNwIGzfA2zqqD1nk4wwPgIcXLwuwCnAPuCp8PXkDl+j44H/AX4ita3T14ckaNeA/yPJKDvz\nXhOSrtrfhPPqAHBBk23RzAGRCH131URGSYEjEkGBIxJBgSMSQYEjEkGBIxJBgSMSQYEjEuH/Af+w\nsI93yQh/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "img=cv2.imread('i.png')\n",
    "SaltAndPepper_noiseImage = SaltAndPepper(img,0.1,0,255)\n",
    "plt.imshow(SaltAndPepper_noiseImage)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAD5lJREFUeJzt3X+sX3V9x/Hna63oQF0prKSj3VpM\nw8bMNpqm66YxRuYGnaGYSFKzxMY1IctwgzkjZfwx/xz7IZvJRnInbLgQEBFjs+i06Vi2P0YHdEAp\nFSioULi0OhWMJnPV9/44nwvf1u/t/d7P+X3O65HcfO/33PO953NPv6/v+3PO9/T9VURgZsvzE20P\nwKyPHByzDA6OWQYHxyyDg2OWwcExy1BbcCRdLulJSUcl7alrO2Z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05xjHrky5VHLPeaD04ki6X9GRqYrinpTGsl3S/pCOSDku6\nLi3/mKQXJD2SvrY3OKavSTqUtvtQWrZa0j5JT6fbcxsay8UT++ARSa9Iur7p/TOtOeZi+6T25pgR\n0doXsAJ4BrgIOAt4FLikhXGspeibAPAm4CngEuBjwEda2jdfA84/bdmfA3vS93uAm1v6N3uJ4v2O\nRvcP8A5gM/D4UvsE2A58kaLz0jbgQJVjabvibAWORsSzEfED4G6KpoaNioj5iDiYvv8ucISO9IM7\nzQ7gjvT9HcBVLYzhMuCZiPh60xuO6c0xF9sntTbHbDs4nWtgKGkDcClwIC36UCr1tzc1NUoC+LKk\nh1MPOoALInUNSrdrGhzPgp3AXRP329o/CxbbJ7U+t9oOzswNDJsg6Y3AZ4HrI+IVit7XbwF+BZgH\n/qrB4bwtIjZT9OO+VtI7Gtz2VJLOAq4EPpMWtbl/llLrc6vt4MzcwLBukl5HEZo7I+I+gIg4HhE/\njIgfUbS72trUeCLixXR7Avhc2vbxhelGuj3R1HiSK4CDEXE8ja21/TNhsX1S63Or7eA8CGyStDG9\nmu2kaGrYKBWtPW8DjkTExyeWT86J3wv82Eed1DSecyS9aeF7inbDj1Psm11ptV3A55sYz4T3MzFN\na2v/nGaxfVJvc8ymz8pMOVOyneIs1jPATS2N4e0UZfwx4JH0tR34J+BQWr4XWNvQeC6iOMP4KHB4\nYb8A5wH7gafT7eoG99HZwP8APzWxrNH9QxHaeeD/KCrK7sX2CcVU7W/T8+oQsKXKsfjKAbMMbU/V\nzHrJwTHL4OCYZXBwzDI4OGYZHByzDA6OWQYHxyzD/wMtWD3AF81QsgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 闭运算\n",
    "closing = cv2.morphologyEx(SaltAndPepper_noiseImage, cv2.MORPH_CLOSE, kernel)\n",
    "plt.imshow(closing)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM4AAAD8CAYAAAA/rZtiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAEVZJREFUeJzt3X2sZeVVx/Hvz5nSCm3lTcjIoAwN\nQbFRmRBE2zRNsQpjw2BSkmlMSuokxEgVrE0Z5A/7p/hStImSjAWlhkCR0nRiWu1kxOgfMvIiMAxT\nYKAtDFxmWttC0ybWaZd/7OfImcs5c8959vvev08yOffsu+/Zz92z11lrP2fftRURmNlyfqTtAZj1\nkQPHLIMDxyyDA8csgwPHLIMDxyxDbYEj6TJJT0k6KGlHXdsxa4Pq+BxH0jrgaeC9wCHgQeADEfFk\n5Rsza0FdGedi4GBEPBcR3wfuBrbWtC2zxq2v6XXPAl6Yen4I+MV5K0vy5QvWFd+IiB9fa6W6Akcz\nlh0THJKuAa6paftmub62yEp1Bc4h4Oyp5xuBl6ZXiIidwE5wxrH+qesc50HgPEmbJJ0AbAN21bQt\ns8bVknEi4qikDwP/DKwDbo+I/XVsy6wNtUxHLz0Il2rWHQ9HxEVrreQrB8wyOHDMMjhwzDLUNR1t\nA7Ts+bA06+O8YXDg2DGqnCyKiMEGj0s1swwOHPt/dXw0ERG1vG7bHDhmGRw4Zhk8OWCDLKXq5sAZ\nuUWDZpHZseO91tBm2Bw4I1VlwEyvu1bwLPuaXeVzHLMMDhyzDA4cm2sIJVVdHDhmGRw49jqSsrPN\nWLKUA8eOMZYDvywHjlkGB45ZhuzAkXS2pPslHZC0X9J1afmpknZLeiY9nlLdcM26oUzGOQr8QUT8\nDHAJcK2kC4AdwJ6IOA/Yk56bDUp24ETESkQ8kr7+DnCAomf0VuCOtNodwJVlB2nN8QWfi6nk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LrNSJS24AJD20yKUOTfF41ta1MTU5HpdqZhkcOGYZuhQ4O9sewCoe\nz9q6NqbGxtOZcxyzPulSxjHrjdYDR9Jlkp5KTQx3tDSGsyXdL+mApP2SrkvLPy7pRUmPpn9bGhzT\nVyXtS9t9KC07VdJuSc+kx1MaGsv5U/vgUUmvSrq+6f0zqznmvH1Se3PMtfqK1fkPWAc8C5wLnAA8\nBlzQwjg2UPRNAHgL8DRwAfBx4KMt7ZuvAqevWvYnwI709Q7g5pb+z16m+Lyj0f0DvAvYDDyx1j4B\ntgBfpOi8dAmwt8qxtJ1xLgYORsRzEfF94G6KpoaNioiViHgkff0d4AAN94Nb0FbgjvT1HcCVLYzh\nUuDZiPha0xuO2c0x5+2TWptjth04rTcwXE3SOcCFwN606MMp1d/eVGmUBPAlSQ+nHnQAZ0bqGpQe\nz2hwPBPbgLumnre1fybm7ZNaj622A2fhBoZNkPRm4LPA9RHxKkXv67cBvwCsAH/e4HDeERGbKfpx\nXyvpXQ1ueyZJJwBXAP+QFrW5f9ZS67HVduAs3MCwbpLeQBE0d0bEfQARcTgifhARP6Rod3VxU+OJ\niJfS4xHgc2nbhyflRno80tR4ksuBRyLicBpba/tnyrx9Uuux1XbgPAicJ2lTejfbRtHUsFEqOgre\nBhyIiE9MLZ+uiX8DeN2tTmoaz0mS3jL5mqLd8BMU++bqtNrVwOebGM+UDzBVprW1f1aZt0/qbY7Z\n9KzMjJmSLRSzWM8CN7U0hndSpPHHgUfTvy3A3wP70vJdwIaGxnMuxQzjY8D+yX4BTgP2AM+kx1Mb\n3EcnAv8N/NjUskb3D0XQrgD/S5FRts/bJxSl2l+l42ofcFGVY/GVA2YZ2i7VzHrJgWOWwYFjlsGB\nY5bBgWOWwYFjlsGBY5bBgWOW4f8AzVBL89ZtSZQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 形态学梯度\n",
    "img=cv2.imread('i.png')\n",
    "gradient = cv2.morphologyEx(img, cv2.MORPH_GRADIENT, kernel)\n",
    "plt.imshow(gradient)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEICAYAAADlQMlVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJztvX90W9d15/vZoEFBoCjBkiBRhETD\nYqlQZOsokSkzvzyeKmlix7OsmYZaTl8bJ/U8e71J2vdmeeZNMn1t6Ddrpj9W5+U102lat/HYSTtx\nqHgieyLHTSLbtV9TyUxUxw5pmrIlWCIpijQlSBQpihB43h+49/oCBEiQAAhccH/WwgJ478XF0b1b\n37vPPvvsI8YYFEVRvICv3A1QFEXJFxUsRVE8gwqWoiieQQVLURTPoIKlKIpnUMFSFMUzrErBEpF/\nLyJ/Vexj8ziXEZFfKMa5FCUXIhK1bO2GAs/zfRG5r1jtKgZSDXlYIvJZ4CGgGbgMfBf4kjEmXs52\nZSIiBmgxxrxZ7rYolYOIxIB/aYz5UZHOFwVOA35jzPVinLNS8LyHJSIPAX8I/FtgA9AJ3AT8UERq\nsxxf0FNHUZTy4WnBEpH1wMPAbxljnjXGJIwxMeAgKdH6dRHpFpHviMhfi8hl4LPWtr92neczIvK2\niEyIyO+KSExEPmrtc451udr3icgZEXlHRH7HdZ59IvIPIhIXkXMi8qfZRFNRFkNEbhSR74nIuIhc\ntD5vd+1/QUR+X0ReFpFLIvKUiGzMca7PicjrIjIpIqdE5MGM/feIyCsicllE3hKRT7h+419an5tF\n5Dnr/8g7IvI3IhJynSMmIv9GRF612vNtEQkU+7p4WrCADwIB4H+4NxpjrgDfBz5mbboH+A4QA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BPW1MgqpXHmD8V5IvAUWNMC3DU+htS16TFej1AKj9I\n8Qhq20AJbLvcHtY+4E1jzCljzCzwBKkpEFVJjqkg9wCPW58fBw64tn/DpDgGhDKG3JXKRm27BLZd\nbsGKAGddf+ec7lDFbDXGnAOw3rdY2/XaeBu9fyWw7XILVt7THVYhem28jd6/3Cz72pRbsHS6A5y3\n3WHrfczartfG2+j9K4Ftl1uweoEWEblZRGpJ1Rt6usxtWmmeBu6zPt8HPOXa/hlrRKUTuGS714on\nUNsuhW0bY8r6Au4CBoG3gN8pd3tK/G/9FnAOSJB6ytwPbCI1gnLSet9oHSukRpneAl4Dbi13+/W1\n5Puttl1k29apOYqieIZydwkVRVHyRgVLURTPoIKlKIpnUMFSFMUzqGApiuIZVLAURfEMKliKoniG\n/x9g5ucpn0ZFxAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 4 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 高通滤波器：Sobel，Scharr 和 Laplacian\n",
    "img=cv2.imread('i.png',0)\n",
    "\n",
    "#cv2.CV_64F 输出图像的深度（数据类型），可以使用-1, 与原图像保持一致 np.uint8\n",
    "laplacian=cv2.Laplacian(img,cv2.CV_64F)\n",
    "# 参数 1,0 为只在 x 方向求一阶导数，最大可以求 2 阶导数。\n",
    "sobelx=cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)\n",
    "# 参数 0,1 为只在 y 方向求一阶导数，最大可以求 2 阶导数。\n",
    "sobely=cv2.Sobel(img,cv2.CV_64F,0,1,ksize=5)\n",
    "\n",
    "plt.subplot(2,2,1),plt.imshow(img,cmap = 'gray')\n",
    "plt.title('Original')\n",
    "plt.subplot(2,2,2),plt.imshow(laplacian,cmap = 'gray')\n",
    "plt.title('Laplacian')\n",
    "plt.subplot(2,2,3),plt.imshow(sobelx,cmap = 'gray')\n",
    "plt.title('Sobel X')\n",
    "plt.subplot(2,2,4),plt.imshow(sobely,cmap = 'gray')\n",
    "plt.title('Sobel Y')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
